<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
%>
<form id="pagerForm" method="post" action="<%=path%>/expenditure/expenditures.do"> 
	<input type="hidden" name="pageNum" value="1" /> 
	<input type="hidden" name="numPerPage" value="${pager.numPerPage}" />
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="<%=path %>/expenditure/expenditures.do"
		method="post">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>名称：<input type="text" name="keyword" value="${keyword}"/></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div></li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<%=path %>/expenditure/addPage.do" target="navTab"><span>添加</span></a></li>
			<li><a class="delete"
				href="<%=path %>/expenditure/delete.do?id={expenditure_id}" target="ajaxTodo"
				title="确定要删除吗?"><span>删除</span></a></li>
			<li><a class="edit" href="<%=path %>/expenditure/getExpenditure.do?id={expenditure_id}"
				target="navTab"><span>修改</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="80" align="center">序号</th>
				<th width="120" align="center">员工</th>
				<th width="120" align="center">类型</th>
				<th width="120" align="center">金额</th>
				<th width="200" align="center">原因</th>
				<th width="100" align="center">创建时间</th>
				<th width="80">备注</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${expenditures}" var="expenditure" varStatus="status">
			<tr target="expenditure_id" rel="${expenditure.id}">
				<td>${status.count}</td>
				<td>${expenditure.employee.name}</td>
				<td>${expenditure.type.description}</td>
				<td>${expenditure.money}</td>
				<td>${expenditure.reason}</td>
				<td><fmt:formatDate value="${expenditure.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${expenditure.remark}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span> <select class="combox" name="numPerPage"
				onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="20" <c:if test="${pager.numPerPage == 20}">selected="selected"</c:if>>20</option>
				<option value="50" <c:if test="${pager.numPerPage == 50}">selected="selected"</c:if>>50</option>
				<option value="100" <c:if test="${pager.numPerPage == 100}">selected="selected"</c:if>>100</option>
				<option value="200" <c:if test="${pager.numPerPage == 200}">selected="selected"</c:if>>200</option>
			</select> <span>条，共${pager.totalCount}条</span>
		</div>

		<div class="pagination" targetType="navTab" totalCount="${pager.totalCount}" numPerPage="${pager.numPerPage}" pageNumShown="10" currentPage="${pager.currentPage}"></div>

	</div>
</div>
